package com.zr.daoImpl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import com.zr.dao.XgmmDao;
import com.zr.util.JDBCUtil;

public class XgmmDaoImpl implements XgmmDao{

	@Override
	public boolean getxgmm(int eid, String userpsw) {
		boolean b=false;
		StringBuffer sql=new StringBuffer("UPDATE employee SET epsw=? where eid=?");
		Connection con=JDBCUtil.getConnection();
		try {
			PreparedStatement pst=con.prepareStatement(sql.toString());
			pst.setString(1, userpsw);
			pst.setInt(2, eid);
			int i=pst.executeUpdate();
			if(i>0){
				b=true;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return b;
	}

}
